<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
    <script>
        // 节点属性
        // nodeName 节点名称
        // nodeType 节点类型
        // nodeValue 节点值
          //元素---1
          //属性--2
          //文本--3
          //注释--4
          //文档--5

        //设置或者修改节点的属性
        //getAttribute()获取当前的元素属性
        //setAttribute()
    </script>
</head>
<body>
    <ul id="nodelist">
        <li>nodeName</li>
        <li>nodeType</li>
        <li>nodeValue</li>
    </ul>
    <script>
        let nodes=document.getElementById("nodelist");
        let type1 = nodes.firstElementChild.nodeType;
        let type2 = nodes.firstElementChild.
        firstElementChild;
        let name1 = nodes.firstElementChild.nodeName
        let value1 = nodes.firstElemenptChild.nodeName

        console.log("type1");
        console.log("name1");
        console.log("value1");
    </script>

    <p>选择你喜欢的物品
        <input type="radio" name="mouse" onclick="mouse()">罗技鼠标
        <input type="radio" name="mouse" onclick="mouse()">雷蛇鼠标
    </p>
    <div><img src="" alt="" id="images"></div>
    <script>
        function mouse(){
            let ele = document.getElementsByName("mouse");
            let img = document.getElementById("images");
            if(ele[0].checked){
                console.log('罗技');
                img.setAttribute("src","./img/gj.jpg");
                img.setAttribute("slt","雷蛇鼠标")
                img.nextElementSibling.innerHTML="aaa"

            }else{
                console.log('雷蛇');
                img.setAttribute("src","./img/ls.jpg");
                img.nextElementSibling.innerHTML="bbbb"
            }
        }

        functionimg();{
            let alt = document.getElementById("images").getAttribute("src");
            getAttribute("src");
            alert(alt)

        }
    </script>
</body>
</html>